package com.finance.rule.controller;

import com.finance.framework.lang.Page;
import com.finance.framework.lang.PageResultBO;
import com.finance.framework.controller.BaseController;
import com.finance.framework.controller.Result;
import com.finance.rule.bean.pojo.SettingLog;
import com.finance.rule.bean.pojo.SettingLogList;
import com.finance.rule.request.SettingLogListReq;
import com.finance.rule.service.ISettingLogService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.annotation.Resource;

/**
 * Created by ljg on 2017/3/24.
 */
@Controller
@RequestMapping("/rule/settinglog")
public class SettingLogController extends BaseController{

    @Resource
    private ISettingLogService settingLogService;

    @RequestMapping("/index.htm")
    public String index(){
        return "rule/settinglog/index";
    }

    @RequestMapping("/list")
    public Result list(SettingLogListReq form){
        Page page = Page.getInstance(form);
        SettingLogList list = new SettingLogList();
        list.setTarget(form.getTarget());
        list.setDescription(form.getDescription());
        page.setParams(list);
        PageResultBO<SettingLog> resultBO = settingLogService.listByPage(page);
        return getSuccessResult(resultBO);
    }

}
